#ifndef F_CASsiSPIDriverE_h
#define F_CASsiSPIDriverE_h


//******************************************************************************
// EDROOM Service Library

#define _EDROOM_IS_DEBUG_

#define _EDROOM_IS_EMBEDDED_

#include <public/edroomsl.h>

// Data Classes

#include <public/cdsignal.h>
// Data Classes

#include <public/cdframe.h>

//******************************************************************************
// Required Software Interfaces

#include <cassispidriver/required_swi.h>
//******************************************************************************
// Component Class   CASsiSPIDriver

class CASsiSPIDriver: public CEDROOMComponent {

public:

	//*********************** Component Signal Enum Type ***********************

	 enum EDROOMCASsiSPIDriverSignal { EDROOMSignalTimeout, EDROOMSignalDestroy, EDROOMIRQsignal, SDataFrame, SSignalFrame };

	//***************************** Component Memory ***************************

	class CEDROOMMemory: public CEDROOMComponentMemory{

		private:

			//CQueueHead

			CEDROOMQueue::CQueueHead QueueHeads[EDROOMprioMINIMUM+1];

			public:



			// SetMemory
			void SetMemory(TEDROOMUInt32 numMessages_, CEDROOMMessage * MessagesMem_, TEDROOMBool * MessagesMemMarks_, CEDROOMQueue::CQueueNode * QueueNodesMem_, TEDROOMBool * QueueNodesMemMarks_);

	};


	//*****************************	Component Ports ****************************

	CEDROOMInterface	SsiFromComponent;


	// ******************************** IRQ Handling ****************************

	// IRQ num 3
	static Pr_IRQEvent	EDROOMEventIRQ3;
	static Pr_SemaphoreBin	EDROOMSemEndIRQ3;
	static Pr_IRQHandler_RetType	EDROOMIRQ3Handler(void);
	static void	EDROOMIRQ3AuxHandler(void);
	static Pr_IRQHandler_RetType	EDROOMIRQ3IdleHandler(void);
	static void 	EDROOMIRQ3InterTask(void);
	Pr_Task 	EDROOMIRQ3InterT;
	static CEDROOMIRQInterface	SSIIrq;




	// ******************************** Constructor ****************************

	CASsiSPIDriver(const char * const roomname, TEDROOMComponentID id, TEDROOMUInt32 roomNumMaxMens, TEDROOMPriority roomtaskPrio, TEDROOMStackSizeType roomStack, CEDROOMMemory * pActorMemory );




	// *************************************************************************

	// **************************** Public Methods	****************************

	// *************************************************************************



	// **************************** Configuration ******************************

	 int EDROOMConfig();


	// ************************************* Start *****************************

	 int EDROOMStart();




	#ifdef _EDROOM_SYSTEM_CLOSE

	// ***************************** IsComponentFinished ***********************

	TEDROOMBool EDROOMIsComponentFinished();


	#endif

	// *************************************************************************

	// **************************** Protected Methods	************************

	// *************************************************************************

protected:



	// *********************************** Behaviour ***************************

	virtual void EDROOMBehaviour();




public:

	// *****************************	Behaviour File *************************

	#include <cassispidriver/CASsiSPIDriverC.h>


protected:

	// ********************************  Top State  ****************************

	EDROOMTopState edroomTopState;



};
#endif
